@extends('admin.layouts.admin')
@section('content')
    <div class="layui-form" lay-filter="LAY-add-forms" id="LAY-add" style="padding: 20px 30px 0 0;">
        <div class="layui-form-item">
            <label class="layui-form-label">父级</label>
            <div class="layui-input-block">
                <select name="pid" lay-verify="">
                    <option value="0">顶级栏目</option>
                    @foreach($category as $val)
                        <option value="{{$val['id']}}">{{$val['html']}}{{$val['name']}}</option>
                    @endforeach
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">分类名称</label>
            <div class="layui-input-block">
                <input type="text" name="name" lay-verify="required" placeholder="分类名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-inline">
                <input type="text" name="order" value="0" lay-verify="required" placeholder="排序" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否显示</label>
            <div class="layui-input-block">
                <input type="checkbox" name="status" lay-skin="switch" lay-text="是|否" value="1" checked>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
                <textarea name="description" placeholder="请输入内容" class="layui-textarea"></textarea>
            </div>
        </div>

        <div class="layui-form-item layui-hide">
            <input type="button" lay-submit lay-filter="LAY-add-forms" id="LAY-add-forms" value="确认">
        </div>
    </div>

@endsection
@section('scripts')
    <script>
        layui.config({
            base: '../' //静态资源所在路径
        }).use([ 'table', 'form'], function(){
            var $ = layui.$
                ,form = layui.form
            form.render('checkbox');

        });//use

    </script>
@stop
